window = global;
window.navigator = {
    appCodeName: "Mozilla",
    appName: "Netscape",
    appVersion: "5.0(windows NT 6.1;wow64)Applewebkit/537.36(KHML, like Gecko)Chrome/74.0.3729.169 safari/537.36",
    cookieEnabled: true,
    doNotTrack: null,
    hardwareConcurrency: 4,
    language: "zh-CN",
    languages: ["zh-CN", "zh"],
    maxTouchPoints: 0,
    onLine: true,
    platform: "Win32",
    product: "Gecko",
    productSub: "20030107",
    userAgent: "Mozilla/5.0 (windows NT 6.1;WOW64)Applewebkit/537.36(KHTML, likeGecko)chrome/74.0.3729.169 safari/537.36",
    vendor: "Google Inc",
    vendorSub: ""
};
document = {};

!function(e, t) {
    var o = function() {
        this.JSSDK = {
            Global: {
                appid: 0,
                appKey: "bfd434f70d40433c6b57a781dbcee91a",
                lcid: 2052,
                sdid: "",
                pageUrl: "",
                pageReferrerUrl: "",
                byPass: 3,
                logLock: !1,
                logTest: !1,
                protocol: "https",
                domain: "huya.com",
                domainList: "",
                exchange: "",
                guid: "",
                session: "udb_session",
                bridge: {
                    name: "huya",
                    success: function() {}
                },
                domainFunc: {
                    login: "udblgn",
                    thrid: "udb3lgn",
                    register: "udbreg",
                    security: "udbsec",
                    api: "udbapi",
                    log: "udblog",
                    html: "aq"
                },
                loadFunc: {
                    login: !0,
                    thrid: !0,
                    register: !0,
                    security: !1,
                    api: !1,
                    log: !1,
                    html: !1
                },
                start: function() {},
                success: function() {},
                complete: function() {},
                error: function() {}
            },
            Command: {
                10001: {},
                10009: {},
                10011: {},
                10013: {},
                10015: {},
                20005: {},
                20009: {},
                20011: {},
                20013: {},
                20017: {},
                20019: {},
                30001: {},
                30003: {},
                30005: {},
                30007: {},
                40001: {},
                40003: {},
                40005: {},
                40020: {},
                40022: {},
                50001: {},
                60001: {},
                60003: {},
                60005: {},
                60007: {},
                60009: {},
                60011: {},
                60013: {},
                60015: {},
                60017: {},
                60019: {},
                60021: {},
                60023: {},
                60025: {},
                60027: {},
                60029: {},
                70001: {},
                70003: {},
                70005: {},
                70007: {},
                70009: {},
                70011: {},
                70013: {},
                70015: {},
                70017: {},
                70019: {},
                70021: {},
                70023: {},
                70025: {}
            },
            Resource: {
                VERSION: "2.5",
                URI: {
                    EXH_CAL: "190001",
                    EXH_ASC: "190002",
                    EXH_LIS: "190003",
                    COR_CAL: "190004",
                    COR_LIS: "190005",
                    COR_SND: "190006",
                    COR_MBL: "190007",
                    COR_JNP: "190009",
                    COR_PCE: "190010",
                    NET_WORK: "190011",
                    SDK_INF: "310000",
                    EVT_RPT: "320000",
                    INN_MSG: "330000"
                },
                MURTYPE: {
                    10002: "1",
                    10012: "2",
                    10010: "3",
                    10014: "5",
                    20006: "7",
                    20014: "10",
                    20018: "11",
                    60002: "12",
                    60010: "13",
                    60008: "14",
                    60030: "12",
                    70004: "15",
                    99091: "91",
                    99092: "92"
                },
                EXCEPT: {
                    EXH_CAL: {
                        PARSE: "190101",
                        FORMAT: "190102",
                        UNKNOWN: "190103",
                        LALPAR: "190110",
                        LALFMT: "190111",
                        RMTPAR: "190112",
                        RMTFMT: "190113"
                    },
                    EXH_ASC: {
                        PARSE: "190104",
                        ERROR: "190105",
                        FORMAT: "190107",
                        NETOFF: "190108"
                    },
                    EXH_LIS: {
                        ERROR: "190106"
                    },
                    NET_WORK: {
                        ERROR: "-1000"
                    },
                    COR_CAL: {
                        PARSE: "190151",
                        FORMAT: "190152",
                        UNKNOWN: "190153",
                        EXCHANGE: "190159"
                    },
                    COR_LIS: {
                        ERROR: "190154"
                    },
                    COR_SND: {
                        NOTFOUND: "190155",
                        NOTINIT: "190158"
                    },
                    COR_MBL: {
                        NOTSUPT: "190156"
                    },
                    COR_JNP: {
                        TIMEOUT: "190157",
                        LDERROR: "190160"
                    },
                    COR_PCE: {
                        NOTSUPT: "190161"
                    },
                    SDK_INF: {
                        INITSUC: "310101",
                        MOBLCHK: "310102",
                        MOBLCAL: "310103",
                        EXCHSUC: "310104",
                        PCECHK: "310105",
                        PCECAL: "310106",
                        INITSTR: "310107",
                        INITEND: "310108",
                        INITERR: "310109"
                    },
                    EVT_RPT: {
                        SDKLOG: "320100",
                        PGECLK: "320102"
                    },
                    INN_MSG: {
                        UPGSUC: "330100",
                        UPGCAL: "330102",
                        UPGMST: "330103"
                    }
                },
                MESSAGE: {
                    2052: {
                        EXH_CAL: {
                            PARSE: "消息解析错误！",
                            FORMAT: "消息格式错误！",
                            UNKNOWN: "返回消息不能识别！",
                            LALPAR: "本地消息解析错误！",
                            LALFMT: "本地消息格式错误！",
                            RMTPAR: "远程消息解析错误！",
                            RMTFMT: "远程消息格式错误！"
                        },
                        EXH_ASC: {
                            PARSE: "异常命令错误！",
                            ERROR: "服务器错误！",
                            FORMAT: "命令格式错误！",
                            NETOFF: "网络连接不成功！"
                        },
                        EXH_LIS: {
                            ERROR: "监听事件错误！"
                        },
                        NET_WORK: {
                            ERROR: "接口请求出错!"
                        },
                        COR_CAL: {
                            PARSE: "内部解析错误！",
                            FORMAT: "内部格式错误！",
                            UNKNOWN: "内部消息不能识别！",
                            EXCHANGE: "内部消息标识错误！"
                        },
                        COR_LIS: {
                            ERROR: "内部服务错误！"
                        },
                        COR_SND: {
                            NOTFOUND: "没有找到窗口！",
                            NOTINIT: "初始化失败、请重新加载！"
                        },
                        COR_MBL: {
                            NOTSUPT: "非法移动端！"
                        },
                        COR_JNP: {
                            TIMEOUT: "网络超时！",
                            LDERROR: "获取快速登录出错！"
                        },
                        COR_PCE: {
                            NOTSUPT: "非法PC端！"
                        },
                        SDK_INF: {
                            INITSUC: "初始化成功！",
                            MOBLCHK: "移动端加载JS桥成功",
                            MOBLCAL: "移动端回调成功",
                            EXCHSUC: "交换桥初化成功",
                            PCECHK: "PC端加载JS桥成功",
                            PCECAL: "PC端回调成功",
                            INITSTR: "初始化开始",
                            INITEND: "初始化结束",
                            INITERR: "初始化内部错误、请重新加载！"
                        },
                        EVT_RPT: {
                            SDKLOG: "SDK日志上报！",
                            PGECLK: "页面点击事件！"
                        },
                        INN_MSG: {
                            UPGSUC: "升级成功！",
                            UPGCAL: "取消升级！",
                            UPGMST: "升级成功！"
                        }
                    },
                    1033: {
                        EXH_CAL: {
                            PARSE: "Parse Error Messages!",
                            FORMAT: "Format Error Messages!",
                            UNKNOWN: "Unknown Message!",
                            LALPAR: "Local Parse Error Messages!",
                            LALFMT: "Local Format Error Messages!",
                            RMTPAR: "Remote Parse Error Messages!",
                            RMTFMT: "Remote Format Error Messages!"
                        },
                        EXH_ASC: {
                            PARSE: "Parse Error Commamd!",
                            ERROR: "Server Error!",
                            FORMAT: "Format Error Commamd!",
                            NETOFF: "Network Connection Unsuccessful!"
                        },
                        EXH_LIS: {
                            ERROR: "Monitor Event Error!"
                        },
                        NET_WORK: {
                            ERROR: "NET_WORK Error!"
                        },
                        COR_CAL: {
                            PARSE: "Internal Parse Error!",
                            FORMAT: "Internal Format Error!",
                            UNKNOWN: "Unknown Command!",
                            EXCHANGE: "Message ID Error!"
                        },
                        COR_LIS: {
                            ERROR: "Internal Error!"
                        },
                        COR_SND: {
                            NOTFOUND: "Not Found Window!",
                            NOTINIT: "Init Failure,Please reload!"
                        },
                        COR_MBL: {
                            NOTSUPT: "Illegal Mobile!"
                        },
                        COR_JNP: {
                            TIMEOUT: "NETWORK TIMEOUT!",
                            LDERROR: "Quick Login Error!"
                        },
                        COR_PCE: {
                            NOTSUPT: "Illegal PC!"
                        },
                        SDK_INF: {
                            INITSUC: "Init Internal Success!",
                            MOBLCHK: "Mobile Load JSBridge Success!",
                            MOBLCAL: "Mobile Callback Success!",
                            EXCHSUC: "Exchange Init Internal Success!",
                            PCECHK: "PC Load JSBridge Success!",
                            PCECAL: "PC Callback Success!",
                            INITSTR: "Init Internal Start!",
                            INITEND: "Init Internal End!",
                            INITERR: "Init Internal Error,Please reload!"
                        },
                        EVT_RPT: {
                            SDKLOG: "SDK Log Report!",
                            PGECLK: "Page Click!"
                        },
                        INN_MSG: {
                            UPGSUC: "UpGrade Success！",
                            UPGCAL: "UpGrade Cancel！",
                            UPGMST: "UpGrade Success！"
                        }
                    }
                }
            }
        },
            this.Security.init(this)
    };
    o.prototype.init = function(o) {
        var a = this
            , n = a.JSSDK.Global;
        o.VERSION && (a.JSSDK.Resource.VERSION = o.VERSION);
        var s = a.JSSDK.Resource.VERSION;
        n = a.Util.extend(n, o),
            a.UserAction.action.furl = (n.pageReferrerUrl || t.referrer).split("?")[0],
            a.UserAction.action.curl = (n.pageUrl || location.href).split("?")[0],
            n.guid = a.Cookie.get("udb_guiddata"),
        n.hasOwnProperty("start") && n.start && "function" == typeof n.start && n.start.call(e),
        (void 0 == n.guid || "" == n.guid) && (n.guid = a.Util.guid(),
            a.Cookie.set("udb_guiddata", n.guid, n.domain, 365)),
        n.exchange || (n.exchange = a.Util.guid(1));
        try {
            a.Message.error("SDK_INF", "INITSTR")
        } catch (i) {}
        a.Mobile.check(n.bridge),
            a.PC.check(),
            a.Html.add({
                tag: "iframe",
                urlList: [n.loadFunc.hasOwnProperty("login") && n.loadFunc.login || !n.loadFunc.hasOwnProperty("login") ? {
                    id: "udb_exchangelgn" + n.session,
                    url: n.protocol + "://" + n.domainFunc.login + "." + n.domain + "/web/middle/" + encodeURIComponent(s) + "/" + n.exchange + "/" + n.protocol + "/" + n.guid
                } : null, n.loadFunc.hasOwnProperty("thrid") && n.loadFunc.thrid || !n.loadFunc.hasOwnProperty("thrid") ? {
                    id: "udb_exchange3lgn" + n.session,
                    url: n.protocol + "://" + n.domainFunc.thrid + "." + n.domain + "/web/middle/" + encodeURIComponent(s) + "/" + n.exchange + "/" + n.protocol + "/" + n.guid
                } : null, n.loadFunc.hasOwnProperty("register") && n.loadFunc.register || !n.loadFunc.hasOwnProperty("register") ? {
                    id: "udb_exchangereg" + n.session,
                    url: n.protocol + "://" + n.domainFunc.register + "." + n.domain + "/web/middle/" + encodeURIComponent(s) + "/" + n.exchange + "/" + n.protocol + "/" + n.guid
                } : null, n.loadFunc.hasOwnProperty("security") && n.loadFunc.security ? {
                    id: "udb_exchangesec" + n.session,
                    url: n.protocol + "://" + n.domainFunc.security + "." + n.domain + "/web/middle/" + encodeURIComponent(s) + "/" + n.exchange + "/" + n.protocol + "/" + n.guid
                } : null, n.loadFunc.hasOwnProperty("api") && n.loadFunc.api ? {
                    id: "udb_exchangeapi" + n.session,
                    url: n.protocol + "://" + n.domainFunc.api + "." + n.domain + "/web/middle/" + encodeURIComponent(s) + "/" + n.exchange + "/" + n.protocol + "/" + n.guid
                } : null],
                success: function() {
                    try {
                        a.Message.error("SDK_INF", "INITSUC")
                    } catch (t) {}
                    n.hasOwnProperty("success") && n.success && "function" == typeof n.success && n.success.call(e)
                },
                error: function(t) {
                    try {
                        a.Message.error("SDK_INF", "INITERR", t.message)
                    } catch (o) {}
                    n.hasOwnProperty("error") && n.error && "function" == typeof n.error && n.error.call(e)
                }
            });
        try {
            a.Message.error("SDK_INF", "INITEND")
        } catch (i) {}
        n.hasOwnProperty("complete") && n.complete && "function" == typeof n.complete && n.complete.call(e)
    }
        ,

        o.prototype.Security = {
            init: function(e) {
                this.$parent = e,
                    this.$global = e.JSSDK.Global,
                    this.$message = e.Message,
                    this.$mobile = e.Mobile,
                    this.$item = e.Item,
                    this.V2.init(this)
            },
            V2: prototype = {
                init: function(e) {
                    this.$parent = e,
                        this.$global = e.$global,
                        this.$message = e.$message,
                        this.$mobile = e.$mobile,
                        this.$item = e.$item
                },
                check: function(e) {
                    var t = "60019"
                        , o = this
                        , a = o.$parent.$parent
                        , n = o.$mobile
                        , s = o.$message
                        , i = o.$global
                        , r = o.$item;
                    e = a.Util.store(t, a, e, 2),
                        1 == e.style || 2 == e.style && !n.able() ? s.send("udb_exchangesec" + i.session, s.encode(i.protocol + "://" + i.domainFunc.security + "." + i.domain + "/web/appeal/checkAccount", "post", t, "WB", '{"user":"' + r.convert(e.data.user) + '","behavior":"' + r.convert(e.data.behavior) + '","page":"' + a.Util.href() + '"}')) : 2 == e.style && n.able() && n.get("common", function(o) {
                            s.send("udb_exchangesec" + i.session, s.encode(i.protocol + "://" + i.domainFunc.security + "." + i.domain + "/wup/appeal/checkAccount", "post", t, "H5", '{"user":"' + r.convert(e.data.user) + '","wupData":"' + r.convert(o) + '","behavior":"' + r.convert(e.data.behavior) + '","page":"' + a.Util.href() + '"}'))
                        })
                }
            },
            SHA1: prototype = {
                hexEncode: function(e) {
                    return this.toHex(this.core(this.toArray(e)))
                },
                toArray: function(e) {
                    for (var t = (e.length + 8 >> 6) + 1, o = new Array(16 * t), a = 0; 16 * t > a; a++)
                        o[a] = 0;
                    for (a = 0; a < e.length; a++)
                        o[a >> 2] |= e.charCodeAt(a) << 24 - 8 * (3 & a);
                    return o[a >> 2] |= 128 << 24 - 8 * (3 & a),
                        o[16 * t - 1] = 8 * e.length,
                        o
                },
                toHex: function(e) {
                    for (var t = "0123456789abcdef", o = "", a = 0; a < 4 * e.length; a++)
                        o += t.charAt(e[a >> 2] >> 8 * (3 - a % 4) + 4 & 15) + t.charAt(e[a >> 2] >> 8 * (3 - a % 4) & 15);
                    return o
                },
                core: function(e) {
                    for (var t = e, o = new Array(80), a = 1732584193, n = -271733879, s = -1732584194, i = 271733878, r = -1009589776, c = 0; c < t.length; c += 16) {
                        for (var d = a, l = n, p = s, u = i, h = r, m = 0; 80 > m; m++) {
                            o[m] = 16 > m ? t[c + m] : this.rol(o[m - 3] ^ o[m - 8] ^ o[m - 14] ^ o[m - 16], 1);
                            var g = this.add(this.add(this.rol(a, 5), this.ft(m, n, s, i)), this.add(this.add(r, o[m]), this.kt(m)));
                            r = i,
                                i = s,
                                s = this.rol(n, 30),
                                n = a,
                                a = g
                        }
                        a = this.add(a, d),
                            n = this.add(n, l),
                            s = this.add(s, p),
                            i = this.add(i, u),
                            r = this.add(r, h)
                    }
                    return new Array(a,n,s,i,r)
                },
                add: function(e, t) {
                    var o = (65535 & e) + (65535 & t)
                        , a = (e >> 16) + (t >> 16) + (o >> 16);
                    return a << 16 | 65535 & o
                },
                rol: function(e, t) {
                    return e << t | e >>> 32 - t
                },
                ft: function(e, t, o, a) {
                    return 20 > e ? t & o | ~t & a : 40 > e ? t ^ o ^ a : 60 > e ? t & o | t & a | o & a : t ^ o ^ a
                },
                kt: function(e) {
                    return 20 > e ? 1518500249 : 40 > e ? 1859775393 : 60 > e ? -1894007588 : -899497514
                }
            }
        },

        e.HyUDBWebErr = "",
        e.HyUDBWebSDK = new o,
        e.onerror = function(t, o, a, n, s) {
            try {
                var i = encodeURIComponent(t + "-" + o + "-" + a + "-" + n + "-" + s)
                    , r = "300000-" + i
                    , c = "JS-"
                    , d = "";
                if (e.HyUDBWebErr != r) {
                    e.HyUDBWebErr = r;
                    try {
                        d = encodeURIComponent(location.href),
                            d = d && void 0 != d && "" != d ? d.toLowerCase() : "";
                        var l = e.HyUDBWebSDK.Item
                            , p = e.HyUDBWebSDK.Cookie;
                        c = "JS-" + l.convert(p.get("udb_guiddata")) + "-" + l.convert(p.get("__yamid_new")) + "-" + l.convert(p.get("guid"))
                    } catch (u) {}
                    d && void 0 != d && "" != d && d.indexOf("udblgn.") > -1 && d.indexOf("udb3lgn.") > -1 && d.indexOf("udbsec.") > -1 && d.indexOf("udbapi.") > -1 && d.indexOf("udbreg.") > -1 && d.indexOf("aq.") > -1 && e.HyUDBWebSDK.Report.error({
                        uri: 3e5
                    }, {
                        uri: 3e5,
                        version: "2.2",
                        context: c,
                        returnCode: 3e5,
                        message: encodeURIComponent(i),
                        description: "javascript script error",
                        data: {
                            page: d
                        }
                    })
                }
            } catch (u) {}
        }
}(window, document);

console.log(window.HyUDBWebSDK.Security.SHA1.hexEncode("123123"))

// "601f1889667efaebb33b8c12572835da3f027f78"
// "601f1889667efaebb33b8c12572835da3f027f78"